home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / truncate.man < prev    next >
Encoding:
Text File  |  1989-10-09  |  2.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TRUNCATE              C Library Procedures               TRUNCATE
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      truncate - truncate a file to a specified length
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ttrruunnccaattee((ppaatthh,, lleennggtthh))
  13.      cchhaarr **ppaatthh;;
  14.      ooffff__tt lleennggtthh;;
  15.  
  16.      ffttrruunnccaattee((ffdd,, lleennggtthh))
  17.      iinntt ffdd;;
  18.      ooffff__tt lleennggtthh;;
  19.  
  20. DDEESSCCRRIIPPTTIIOONN
  21.      _T_r_u_n_c_a_t_e causes the file named by _p_a_t_h or referenced by _f_d
  22.      to be truncated to at most _l_e_n_g_t_h bytes in size.  If the
  23.      file previously was larger than this size, the extra data is
  24.      lost.  With _f_t_r_u_n_c_a_t_e, the file must be open for writing.
  25.  
  26. RREETTUURRNN VVAALLUUEESS
  27.      A value of 0 is returned if the call succeeds.  If the call
  28.      fails a -1 is returned, and the global variable _e_r_r_n_o speci-
  29.      fies the error.
  30.  
  31. EERRRROORRSS
  32.      _T_r_u_n_c_a_t_e succeeds unless:
  33.  
  34.      [ENOTDIR]      A component of the path prefix is not a
  35.                     directory.
  36.  
  37.      [EINVAL]       The pathname contains a character with the
  38.                     high-order bit set.
  39.  
  40.      [ENAMETOOLONG] A component of a pathname exceeded 255 char-
  41.                     acters, or an entire path name exceeded 1023
  42.                     characters.
  43.  
  44.      [ENOENT]       The named file does not exist.
  45.  
  46.      [EACCES]       Search permission is denied for a component
  47.                     of the path prefix.
  48.  
  49.      [EACCES]       The named file is not writable by the user.
  50.  
  51.      [ELOOP]        Too many symbolic links were encountered in
  52.                     translating the pathname.
  53.  
  54.      [EISDIR]       The named file is a directory.
  55.  
  56.      [EROFS]        The named file resides on a read-only file
  57.                     system.
  58.  
  59.      [ETXTBSY]      The file is a pure procedure (shared text)
  60.  
  61.  
  62.  
  63. Sprite v1.0              March 29, 1986                         1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TRUNCATE              C Library Procedures               TRUNCATE
  71.  
  72.  
  73.  
  74.                     file that is being executed.
  75.  
  76.      [EIO]          An I/O error occurred updating the inode.
  77.  
  78.      [EFAULT]       _P_a_t_h points outside the process's allocated
  79.                     address space.
  80.  
  81.      _F_t_r_u_n_c_a_t_e succeeds unless:
  82.  
  83.      [EBADF]        The _f_d is not a valid descriptor.
  84.  
  85.      [EINVAL]       The _f_d references a socket, not a file.
  86.  
  87.      [EINVAL]       The _f_d is not open for writing.
  88.  
  89. SSEEEE AALLSSOO
  90.      open(2)
  91.  
  92. BBUUGGSS
  93.      These calls should be generalized to allow ranges of bytes
  94.      in a file to be discarded.
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0              March 29, 1986                         2
  130.  
  131.  
  132.  
  133.